package com.csjy.migration.hnnd.workflow;


import com.csjy.migration.hnnd.BusinessTool;
import com.csjy.migration.hnnd.DbUtil;
import com.csjy.migration.hnnd.DictTool;
import com.csjy.migration.hnnd.ProgramArgument;
import com.csjy.migration.hnnd.annotation.Task;
import com.csjy.migration.hnnd.business.SourceBusinessData;
import com.csjy.migration.hnnd.dict.Office;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*项目增量受理（item-accept-increase-hny)
phs*/

public class ItemAcceptIncreaseHny extends WorkflowMigration{
    private static Map<String,String> officeDictMap = new HashMap<String,String>();

    public ItemAcceptIncreaseHny(DbUtil sourceDbUtil, DbUtil targetDbUtil, SourceBusinessData sourceData, ProgramArgument programArgument, String projectId, String procInstId, Map procInstRow) throws Exception {
        super(sourceDbUtil, targetDbUtil, sourceData, programArgument, projectId, procInstId, procInstRow);
        this.customInitData();
    }

    @Override
    public void customInitData() throws Exception {
        this.curBizType = "zlsl";
    }

    @Override
    public void customInsertOrUpdateData() throws Exception {


    }

    @Task("增量受理@项目经理提交申请")
    public void xmjltjsq() throws Exception {

        this.curModelMap.put("all", new String[]{"task1535612063868xyb","下一步"});

        this.curCustomData.put("creditTimeStart",this.getJbpmVarInstValueByName("old_auditTime"));
        this.curCustomData.put("creditTimeEnd",this.getJbpmVarInstValueByName("old_assumpTime"));
        this.curCustomData.put("applyCoverage",this.getJbpmVarInstValueByName("old_transacAssureSum"));
        this.curCustomData.put("origCredit",this.getJbpmVarInstValueByName("old_currAssureSum"));
        this.curCustomData.put("coverageMoney",this.getJbpmVarInstValueByName("old_askAssureSum"));
        this.curCustomData.put("increaseCredit",this.getJbpmVarInstValueByName("askIncAssureSum"));
        this.curAffixTypeCommon ="tjfj";
        this.setCommonData(true,null);

    }
    @Task("增量受理@办事处负责人审批")
    public void bscfzrsp() throws Exception {
        this.curModelMap.put("通过", new String[]{"exclusiveGateway1535613158826tg","通过"});
        this.curModelMap.put("同意", new String[]{"exclusiveGateway1535613158826tg","同意"});
        this.curModelMap.put("不同意", new String[]{"endbty","不同意"});
        this.curCustomData.put("managerA", BusinessTool.getEmpCode(this.getJbpmVarInstValueByName("managerAB")));
        this.setCommonData(true,null);
    }
    @Task("增量受理@分公司负责人审批")
    public void fgsfzrsp() throws Exception {

        this.curModelMap.put("通过", new String[]{"exclusiveGateway1535613766965tg","通过"});
        this.curModelMap.put("同意", new String[]{"exclusiveGateway1535613766965tg","通过"});

        this.curModelMap.put("不同意", new String[]{"endbty","不同意"});

        this.setCommonData(true,null);
    }
    @Task("增量受理@公司融资部审批")
    public void gsrzbsp() throws Exception {

        this.curModelMap.put("通过", new String[]{"exclusiveGateway1535614125702tg","通过"});
        this.curModelMap.put("同意", new String[]{"exclusiveGateway1535614125702tg","通过"});

        this.curModelMap.put("不同意", new String[]{"endbty","不同意"});

        this.setCommonData(true,null);
    }
    @Task("增量受理@林业项目部审批")
    public void lyxmbsp() throws Exception {

        gsrzbsp();
    }
    @Task("增量受理@业务副总经理审批")
    public void ywfzjlsp() throws Exception {

        this.curModelMap.put("同意", new String[]{"task1535612315287ty","同意"});
        this.curModelMap.put("不同意", new String[]{"endbty","不同意"});
        this.setCommonData(true,null);
    }
    @Task("增量受理@A经理出调查协议")
    public void ajlcdcxy() throws Exception {

        this.curModelMap.put("提交指派事务所", new String[]{"task1535612338009tjzpsws","提交指派事务所"});
        this.curModelMap.put("不指派事务所", new String[]{"endbpsws","不指派事务所"});
        this.curModelMap.put("不派事务所", new String[]{"endbpsws","不指派事务所"});

        this.curAffixTypeCommon ="tjfj";
        this.setCommonData(true,null);
    }
    @Task("增量受理@审计内勤指派事务所")
    public void sjnqzpsws() throws Exception {
        this.curModelMap.put("all", new String[]{"endjs","结束"});
        this.setCommonData(true,null);
        this.curCustomData.put("office", DictTool.getTargetDictCode(Office.class, this.getJbpmVarInstValueByName("accountCorp")));
    }
}
